package com.keepsport.keepsportapi.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.keepsport.keepsportapi.dto.UserActivityDto;
import com.keepsport.keepsportapi.dto.UserPlanDto;
import com.keepsport.keepsportapi.entity.UserActivity;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserActivityDao extends BaseMapper<UserActivity> {
    @Select("select count(*) from t_user_activity where aid=#{aid}")
    long selectPersons(int aid);

    @Select("select ua.result,ua.ctime,ua.aid,ta.imgurl,ta.sdate,ta.edate,ta.title from t_user_activity ua inner join t_activity ta on ua.aid = ta.id where ua.uid=#{uid} order by ta.edate ")
    List<UserActivityDto> selectByUid(int uid);

}
